<?php

namespace application\Module;

use library\Core\Db\CDbCriteria;
use application\Model\DistrictModel;

class District {

    
    public function children($parent_code = '') {
        $criteria = new CDbCriteria();
        $criteria->select([
            'code',
            'name',
        ]);
        $criteria->addEqCondition('parent_code', $parent_code);
        $criteria->addEqCondition('status', 1);
        $districtModel = new DistrictModel();
        return $districtModel->getListForArray($criteria);
    }

}
